<?php

namespace app\index\model;

use think\Model;

class Express extends Model
{

    /**
     * 通过模糊匹配用户手机号，查找可能属于用户信息
     * @param string $field  获取的列
     */
    public function getColumn($field){
        // 模糊匹配的条件
        $likephone = [
            substr(session('user.phone'), 0, 7) . '__' . substr(session('user.phone'), -1),
            '_______'. substr(session('user.phone'), -4),
            substr(session('user.phone'), 0, 1) . '__' . substr(session('user.phone'), 3, 4) . '__' . substr(session('user.phone'), -1),
        ];

        $express = $this->where('phone','like', $likephone, 'OR')
        ->where('status', 0);
        return $express->column($field);
    }
}
